package omq.api.logger;


//import java.io.IOException;
//import omq.logger.layout.OmqPatternLeyout;

import org.apache.log4j.BasicConfigurator;
//import org.apache.log4j.ConsoleAppender;
//import org.apache.log4j.FileAppender;
import org.apache.log4j.Logger;
import org.apache.log4j.NDC;

public class OmqLogger {
        private static Logger logger = null;
        public static OmqLogger omqLogger = null;      

        public static OmqLogger getInstance(){
            if (omqLogger == null)
            {
            	omqLogger = new OmqLogger();
            	logger = Logger.getRootLogger();
            }
            return omqLogger;
        }

        protected OmqLogger(){
//        	BasicConfigurator.configure();
//        	NDC.push("Omq Infrastructure ");        	
        }

        public void debug(String msg){
            logger.debug(msg);
        }

        public void info(String msg){
        	logger.info( msg);
        }

        public void error(String msg){
    		logger.error( msg);
        }

        public void error(String msg, Throwable e){
    		logger.error( msg, e);
        }
        public void fatal(String msg){
            logger.fatal( msg);
         }
        public void fatal(String msg, Throwable e){
            logger.fatal( msg ,e);
         }
}
